.class public final Lcom/estrongs/android/pop/zeroconf/a;
.super Lcom/estrongs/android/pop/zeroconf/b;
.source "DNSIncoming.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/pop/zeroconf/a$b;
    }
.end annotation


# instance fields
.field private final h:Lcom/estrongs/android/pop/zeroconf/a$b;


# direct methods
.method public constructor <init>(Ljava/net/DatagramPacket;)V
    .locals 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-virtual {p1}, Ljava/net/DatagramPacket;->getPort()I

    move-result v0

    const/16 v1, 0x14e9

    const/4 v2, 0x0

    if-eq v0, v1, :cond_1

    invoke-virtual {p1}, Ljava/net/DatagramPacket;->getPort()I

    move-result v0

    if-ne v0, v1, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    goto :goto_1

    :cond_1
    :goto_0
    const/4 v0, 0x1

    :goto_1
    invoke-direct {p0, v2, v2, v0}, Lcom/estrongs/android/pop/zeroconf/b;-><init>(IIZ)V

    .line 2
    invoke-virtual {p1}, Ljava/net/DatagramPacket;->getAddress()Ljava/net/InetAddress;

    move-result-object v0

    .line 3
    new-instance v1, Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {p1}, Ljava/net/DatagramPacket;->getData()[B

    move-result-object v3

    invoke-virtual {p1}, Ljava/net/DatagramPacket;->getLength()I

    move-result p1

    invoke-direct {v1, v3, p1}, Lcom/estrongs/android/pop/zeroconf/a$b;-><init>([BI)V

    iput-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    .line 4
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    .line 5
    :try_start_0
    iget-object p1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {p1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result p1

    invoke-virtual {p0, p1}, Lcom/estrongs/android/pop/zeroconf/b;->b(I)V

    .line 6
    iget-object p1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {p1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result p1

    invoke-virtual {p0, p1}, Lcom/estrongs/android/pop/zeroconf/b;->a(I)V

    .line 7
    iget-object p1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {p1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result p1

    .line 8
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v1

    .line 9
    iget-object v3, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v3}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v3

    .line 10
    iget-object v4, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v4}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v4

    if-lez p1, :cond_2

    const/4 v5, 0x0

    :goto_2
    if-ge v5, p1, :cond_2

    .line 11
    iget-object v6, p0, Lcom/estrongs/android/pop/zeroconf/b;->d:Ljava/util/List;

    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/a;->p()Lcom/estrongs/android/pop/zeroconf/d;

    move-result-object v7

    invoke-interface {v6, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v5, v5, 0x1

    goto :goto_2

    :cond_2
    if-lez v1, :cond_4

    const/4 p1, 0x0

    :goto_3
    if-ge p1, v1, :cond_4

    .line 12
    invoke-direct {p0, v0}, Lcom/estrongs/android/pop/zeroconf/a;->a(Ljava/net/InetAddress;)Lcom/estrongs/android/pop/zeroconf/e;

    move-result-object v5

    if-eqz v5, :cond_3

    .line 13
    iget-object v6, p0, Lcom/estrongs/android/pop/zeroconf/b;->e:Ljava/util/List;

    invoke-interface {v6, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_3
    add-int/lit8 p1, p1, 0x1

    goto :goto_3

    :cond_4
    if-lez v3, :cond_6

    const/4 p1, 0x0

    :goto_4
    if-ge p1, v3, :cond_6

    .line 14
    invoke-direct {p0, v0}, Lcom/estrongs/android/pop/zeroconf/a;->a(Ljava/net/InetAddress;)Lcom/estrongs/android/pop/zeroconf/e;

    move-result-object v1

    if-eqz v1, :cond_5

    .line 15
    iget-object v5, p0, Lcom/estrongs/android/pop/zeroconf/b;->f:Ljava/util/List;

    invoke-interface {v5, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_5
    add-int/lit8 p1, p1, 0x1

    goto :goto_4

    :cond_6
    if-lez v4, :cond_8

    :goto_5
    if-ge v2, v4, :cond_8

    .line 16
    invoke-direct {p0, v0}, Lcom/estrongs/android/pop/zeroconf/a;->a(Ljava/net/InetAddress;)Lcom/estrongs/android/pop/zeroconf/e;

    move-result-object p1

    if-eqz p1, :cond_7

    .line 17
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/b;->g:Ljava/util/List;

    invoke-interface {v1, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_7
    add-int/lit8 v2, v2, 0x1

    goto :goto_5

    :cond_8
    return-void

    :catch_0
    move-exception p1

    .line 18
    new-instance v0, Ljava/io/IOException;

    const-string v1, "DNSIncoming corrupted message"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    .line 19
    invoke-virtual {v0, p1}, Ljava/io/IOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    .line 20
    goto :goto_7

    :goto_6
    throw v0

    :goto_7
    goto :goto_6
.end method

.method private a(Ljava/net/InetAddress;)Lcom/estrongs/android/pop/zeroconf/e;
    .locals 10

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->b()Ljava/lang/String;

    move-result-object v2

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v0

    invoke-static {v0}, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;->typeForIndex(I)Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;

    move-result-object v0

    .line 3
    sget-object v1, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;->TYPE_IGNORE:Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;

    .line 4
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v1

    .line 5
    sget-object v3, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;->TYPE_OPT:Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;

    if-ne v0, v3, :cond_0

    sget-object v3, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;->CLASS_UNKNOWN:Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;

    goto :goto_0

    :cond_0
    invoke-static {v1}, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;->classForIndex(I)Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;

    move-result-object v3

    .line 6
    :goto_0
    sget-object v4, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;->CLASS_UNKNOWN:Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;

    if-ne v3, v4, :cond_1

    sget-object v4, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;->TYPE_OPT:Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;

    .line 7
    :cond_1
    invoke-virtual {v3, v1}, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;->isUnique(I)Z

    move-result v4

    .line 8
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->readInt()I

    move-result v5

    .line 9
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v1

    const/4 v6, 0x0

    .line 10
    sget-object v7, Lcom/estrongs/android/pop/zeroconf/a$a;->c:[I

    invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I

    move-result v0

    aget v0, v7, v0

    packed-switch v0, :pswitch_data_0

    .line 11
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    int-to-long v1, v1

    invoke-virtual {v0, v1, v2}, Ljava/io/ByteArrayInputStream;->skip(J)J

    goto/16 :goto_3

    .line 12
    :pswitch_0
    invoke-virtual {p0}, Lcom/estrongs/android/pop/zeroconf/b;->e()I

    move-result v0

    invoke-static {v0, v5}, Lcom/estrongs/android/pop/zeroconf/constants/DNSResultCode;->resultCodeForFlags(II)Lcom/estrongs/android/pop/zeroconf/constants/DNSResultCode;

    const/high16 v0, 0xff0000

    and-int/2addr v0, v5

    shr-int/lit8 v0, v0, 0x10

    if-nez v0, :cond_3

    .line 13
    :goto_1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Ljava/io/ByteArrayInputStream;->available()I

    move-result v0

    if-lez v0, :cond_3

    .line 14
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Ljava/io/ByteArrayInputStream;->available()I

    move-result v0

    const/4 v1, 0x2

    if-lt v0, v1, :cond_3

    .line 15
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v0

    .line 16
    invoke-static {v0}, Lcom/estrongs/android/pop/zeroconf/constants/DNSOptionCode;->resultCodeForFlags(I)Lcom/estrongs/android/pop/zeroconf/constants/DNSOptionCode;

    move-result-object v0

    .line 17
    iget-object v2, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v2}, Ljava/io/ByteArrayInputStream;->available()I

    move-result v2

    if-lt v2, v1, :cond_3

    .line 18
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v1

    .line 19
    iget-object v2, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v2}, Ljava/io/ByteArrayInputStream;->available()I

    move-result v2

    if-lt v2, v1, :cond_2

    .line 20
    iget-object v2, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v2, v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->a(I)[B

    .line 21
    :cond_2
    sget-object v1, Lcom/estrongs/android/pop/zeroconf/a$a;->b:[I

    invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I

    move-result v0

    aget v0, v1, v0

    goto :goto_1

    .line 22
    :pswitch_1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v6

    .line 23
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v7

    .line 24
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v8

    .line 25
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->b()Ljava/lang/String;

    move-result-object v9

    .line 26
    new-instance v0, Lcom/estrongs/android/pop/zeroconf/e$e;

    move-object v1, v0

    invoke-direct/range {v1 .. v9}, Lcom/estrongs/android/pop/zeroconf/e$e;-><init>(Ljava/lang/String;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;ZIIIILjava/lang/String;)V

    goto :goto_2

    .line 27
    :pswitch_2
    new-instance v0, Lcom/estrongs/android/pop/zeroconf/e$f;

    iget-object v6, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v6, v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->a(I)[B

    move-result-object v6

    move-object v1, v0

    invoke-direct/range {v1 .. v6}, Lcom/estrongs/android/pop/zeroconf/e$f;-><init>(Ljava/lang/String;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;ZI[B)V

    goto :goto_2

    .line 28
    :pswitch_3
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->b()Ljava/lang/String;

    move-result-object v0

    .line 29
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    if-lez v1, :cond_3

    .line 30
    new-instance v7, Lcom/estrongs/android/pop/zeroconf/e$d;

    move-object v1, v7

    move-object v6, v0

    invoke-direct/range {v1 .. v6}, Lcom/estrongs/android/pop/zeroconf/e$d;-><init>(Ljava/lang/String;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;ZILjava/lang/String;)V

    move-object v6, v7

    goto :goto_3

    .line 31
    :pswitch_4
    new-instance v0, Lcom/estrongs/android/pop/zeroconf/e$c;

    iget-object v6, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v6, v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->a(I)[B

    move-result-object v6

    move-object v1, v0

    invoke-direct/range {v1 .. v6}, Lcom/estrongs/android/pop/zeroconf/e$c;-><init>(Ljava/lang/String;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;ZI[B)V

    goto :goto_2

    .line 32
    :pswitch_5
    new-instance v0, Lcom/estrongs/android/pop/zeroconf/e$b;

    iget-object v6, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v6, v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->a(I)[B

    move-result-object v6

    move-object v1, v0

    invoke-direct/range {v1 .. v6}, Lcom/estrongs/android/pop/zeroconf/e$b;-><init>(Ljava/lang/String;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;ZI[B)V

    :goto_2
    move-object v6, v0

    :cond_3
    :goto_3
    if-eqz v6, :cond_4

    .line 33
    invoke-virtual {v6, p1}, Lcom/estrongs/android/pop/zeroconf/e;->a(Ljava/net/InetAddress;)V

    :cond_4
    return-object v6

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_5
        :pswitch_4
        :pswitch_3
        :pswitch_3
        :pswitch_2
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method private p()Lcom/estrongs/android/pop/zeroconf/d;
    .locals 4

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v0}, Lcom/estrongs/android/pop/zeroconf/a$b;->b()Ljava/lang/String;

    move-result-object v0

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v1

    invoke-static {v1}, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;->typeForIndex(I)Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;

    move-result-object v1

    .line 3
    sget-object v2, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;->TYPE_IGNORE:Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;

    .line 4
    iget-object v2, p0, Lcom/estrongs/android/pop/zeroconf/a;->h:Lcom/estrongs/android/pop/zeroconf/a$b;

    invoke-virtual {v2}, Lcom/estrongs/android/pop/zeroconf/a$b;->d()I

    move-result v2

    .line 5
    invoke-static {v2}, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;->classForIndex(I)Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;

    move-result-object v3

    .line 6
    invoke-virtual {v3, v2}, Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;->isUnique(I)Z

    move-result v2

    .line 7
    invoke-static {v0, v1, v3, v2}, Lcom/estrongs/android/pop/zeroconf/d;->a(Ljava/lang/String;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordType;Lcom/estrongs/android/pop/zeroconf/constants/DNSRecordClass;Z)Lcom/estrongs/android/pop/zeroconf/d;

    move-result-object v0

    return-object v0
.end method
